package com.weipai.education.dao.impl;

import com.weipai.education.dao.UserEarningsDao;
import com.weipai.education.mapper.UserEarningsMapper;
import com.weipai.education.model.UserEarnings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/12/18 18:54
 */
@Repository
public class UserEarningsDaoImpl implements UserEarningsDao {
    
    @Autowired
    private UserEarningsMapper userEarningsMapper;


    @Override
    public List<Map<String, Object>> list(Integer start, Integer size, String type, String accountNumber, String startTime, String endTime, String userId) {
        return userEarningsMapper.list(start, size, type, accountNumber, startTime, endTime, userId);
    }

    @Override
    public Integer listAmount(String type, String accountNumber, String startTime, String endTime, String userId) {
        return userEarningsMapper.listAmount(type, accountNumber, startTime, endTime, userId);
    }

    @Override
    public BigDecimal getAllRewardPrice(String month, String userId,Integer type) {
        return userEarningsMapper.getAllRewardPrice(month, userId,type);
    }

    @Override
    public BigDecimal getDifferentRewardPrice(List<Integer> type, String userId) {
        return userEarningsMapper.getDifferentRewardPrice(type, userId);
    }

    @Override
    public int insert(UserEarnings earnings) {
        return userEarningsMapper.insert(earnings);
    }
}
